<!DOCTYPE html>
<html lang="en" ng-app="app">
    <head>
        <meta charset="UTF-8">
        <title ng-bind="title"></title>
        <link rel="stylesheet" href="../../style/css/bootstrap.css">
        <link rel="stylesheet" href="../../style/css/matrix-style.css">
        <link rel="stylesheet" href="../win/win.css">
        <script src="../../../node_modules/angular/angular.js"></script>
        <script src="../../a.ui.js"></script>
        <script src="../win/win.js"></script>
        <script src="dialog.js"></script>
        <script>
            // bootstrap app
            var app = angular.module('app', ['a.ui']);
            app.run(function ($rootScope, $dialog) {
                $rootScope.title = 'Dialog';
                $rootScope.msg = 'Message';
                $rootScope.types = ['alert', 'confirm', 'prompt'];
                $rootScope.dialog = function (type) {
                    $dialog[type]($rootScope.msg, function (arg) {
                        console.log(arg);
                    });
                };
            })
        </script>
    </head>
    <body>
        <div class="container">
            <h1 class="text-center" ng-bind="title"></h1>
            <div class="form-group form-inline">
                <label>提示消息:</label>
                <input type="text" class="form-control" ng-model="msg">
            </div>
            <div class="btn-group">
                <button class="btn btn-sm btn-default" ng-repeat="type in types track by $index" ng-click="dialog(type)">{{type}}</button>
            </div>
        </div>
    </body>
</html>